/*
 * PanneauBody.java
 *
 * Created on 11 juil. 2011, 18:30:13
 */
/**
 *
 * @author jannoned
 */
/*
Dominique Jannone
Guillaume Marre
Yohan Ojeda
Laurent Schiavon
*/
package vue;



import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.util.logging.Logger;
import java.util.logging.Level;

import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JToolBar.Separator;
import javax.swing.LayoutStyle;
import javax.swing.SwingConstants;
import javax.swing.plaf.SeparatorUI;

import model.eConf;

import controleur.Control;
import controleur.ControlConference;

public class PanneauMenu extends JPanel {
	
	//log
	public static final Logger logger = Logger.getLogger(PanneauMenu.class.getName());
	
//Attributs
	private JPanel Menu_panel;	
	private JButton jButton_Accueil, jButton_Conference, jButton_CreerConference, jButton_Profile,
			jButton_DemandeProfile,  jButton_Supervision, jButton_Connexion, jButton_Inscription, 
			jButton_Quitter, jButton_APropos, jButton_Vide1, jButton_ArreterLaConf, jButton_Vide3;
	private JSeparator jButton_Separator1, jButton_Separator2; 
	private Fenetre fenetre;
	private eConf eConf;
		
	//Constructeur
		public PanneauMenu(Fenetre fen, eConf econf){
			fenetre = fen;
			eConf= econf;
        	this.initComponents();
        }
		
	// Observateurs
		public JButton getjButton_Accueil() {return jButton_Accueil;}
		public JButton getjButton_Conference() {return jButton_Conference;}
		public JButton getjButton_CreerConference() {return jButton_CreerConference;}
		public JButton getjButton_Profil() {return jButton_Profile;}
		public JButton getjButton_DemandeProfile() {return jButton_DemandeProfile;}
		public JButton getjButton_Supervision() {return jButton_Supervision;}
		public JButton getjButton_Connexion() {return jButton_Connexion;}
		public JButton getjButton_Inscription() {return jButton_Inscription;}
		public JButton getjButton_Quitter() {return jButton_Quitter;}
		public JButton getjButton_APropos() {return jButton_APropos;}
		
	// Mutateurs
		public void setjButton_Connexion(JButton jButton_Connexion) {this.jButton_Connexion = jButton_Connexion;}

		
	// Methode components
		public JPanel initComponents() {
			// Définition du JPanel
			Menu_panel = new JPanel();
  	        Menu_panel.setLayout(new GridLayout(15,1));
	        Menu_panel.setBackground(new Color(149, 193, 209));
	        Menu_panel.setBorder(BorderFactory.createEtchedBorder());
	        Menu_panel.setBorder(BorderFactory.createEtchedBorder());
			// Créaion des composants	
	        jButton_Vide1 = new JButton();
	        jButton_Accueil = new JButton();
  	        jButton_Conference = new JButton();
  	        jButton_CreerConference = new JButton();
  	        jButton_Profile = new JButton();
  	        jButton_DemandeProfile = new JButton();
  	        jButton_Supervision = new JButton();
  	        jButton_ArreterLaConf = new JButton();
  	        jButton_Separator1 = new JSeparator();
  	        jButton_Connexion = new JButton();
  	        jButton_Inscription = new JButton();
  	        jButton_Vide3 = new JButton();
	        jButton_Separator2 = new JSeparator();
  	        jButton_Quitter = new JButton();
  	        jButton_APropos= new JButton();
	        // Définition des composants
  	        jButton_Accueil.setText("Accueil");
	        jButton_Conference.setText("Conférences");
	        jButton_CreerConference.setText("Créer Conférence");
	        jButton_Profile.setText("Profil");
	        jButton_DemandeProfile.setText("Demande Profil");
	        jButton_Supervision.setText("Supervision");
	        jButton_Connexion.setText("Connexion");
	        jButton_Inscription.setText("Inscription");
	        jButton_Quitter.setText("Quitter");
	        jButton_APropos.setText("A Propos");
	        jButton_ArreterLaConf.setText("Fin de conférence");
	        // Ajout des action Listener
	        jButton_Accueil.addActionListener(new Control(fenetre, eConf));
	        jButton_Conference.addActionListener(new Control(fenetre, eConf));
	        jButton_CreerConference.addActionListener(new Control(fenetre, eConf));
	        jButton_Profile.addActionListener(new Control(fenetre, eConf));
	        jButton_DemandeProfile.addActionListener(new Control(fenetre, eConf));
	        jButton_Supervision.addActionListener(new Control(fenetre, eConf));
	        jButton_Connexion.addActionListener(new Control(fenetre, eConf));
	        jButton_Inscription.addActionListener(new Control(fenetre, eConf));
	        jButton_Quitter.addActionListener(new Control(fenetre, eConf));
	        jButton_APropos.addActionListener(new Control(fenetre, eConf));
//	        jButton_ArreterLaConf.addActionListener(new Control(fenetre, eConf));
	        jButton_ArreterLaConf.addActionListener(new Control(fenetre, eConf));
	        // Ajouts des composant dans le conterneur du JPanel
	        Menu_panel.add(jButton_Vide1);
	        Menu_panel.add(jButton_Accueil);
	        Menu_panel.add(jButton_Conference);
	        Menu_panel.add(jButton_CreerConference);
	        Menu_panel.add(jButton_Profile);
	        Menu_panel.add(jButton_DemandeProfile);
	        Menu_panel.add(jButton_Supervision);
	        Menu_panel.add(jButton_ArreterLaConf);
	        Menu_panel.add(jButton_Separator1);
	        Menu_panel.add(jButton_Connexion);
	        Menu_panel.add(jButton_Inscription);
	        Menu_panel.add(jButton_Vide3);
	        Menu_panel.add(jButton_Separator2);
	        Menu_panel.add(jButton_Quitter);
	        Menu_panel.add(jButton_APropos);
	     // Cache ts les boutons
	        jButton_Accueil.setVisible(false);
  	        jButton_Conference.setVisible(false);
  	        jButton_CreerConference.setVisible(false);
  	        jButton_Profile.setVisible(false);
  	        jButton_DemandeProfile.setVisible(false);
  	        jButton_Supervision.setVisible(false);
  	        jButton_Connexion.setVisible(false);
  	        jButton_Inscription.setVisible(false);
  	        jButton_Quitter.setVisible(false);
  	        jButton_APropos.setVisible(false);
  	        jButton_Vide1.setVisible(false);
  	        jButton_ArreterLaConf.setVisible(false);
  	        jButton_Vide3.setVisible(false);
	     // Affichage les butons de new connexion
  	        jButton_Connexion.setVisible(true);
	        jButton_Inscription.setVisible(true);
	        jButton_Quitter.setVisible(true);
	        jButton_APropos.setVisible(true);
	        
	        return Menu_panel;
		}
		
		public void setVisible(JButton jButton, Boolean bool){
			jButton.setVisible(bool);
		}
		
		
		public void isEnableButtonMenu(boolean b){
			jButton_Accueil.setEnabled(b);
			jButton_APropos.setEnabled(b);
			jButton_Conference.setEnabled(b);
			jButton_Connexion.setEnabled(b);
			jButton_CreerConference.setEnabled(b);
			jButton_DemandeProfile.setEnabled(b);
			jButton_Inscription.setEnabled(b);
			jButton_Profile.setEnabled(b);
			jButton_Supervision.setEnabled(b);
			jButton_Quitter.setEnabled(b);
		}
		
		public void ButtonConferenceVisible(boolean b){
			jButton_ArreterLaConf.setVisible(b);
		}

	
		
		
}
            
